@hep-code-runner/vue2 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,2533 @@
1
+ var se = Object.defineProperty, ie = (r, e, t) => e in r ? se(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, V = (r, e, t) => ie(r, typeof e != "symbol" ? e + "" : e, t);
2
+ let G = null;
3
+ class oe {
4
+ constructor(e = {}) {
5
+ V(this, "baseUrl"), V(this, "timeout"), this.baseUrl = e.pistonUrl || "/api/piston", this.timeout = e.timeout || 3e3;
6
+ }
7
+ async getRuntimes(e = !1) {
8
+ if (G && !e)
9
+ return G;
10
+ try {
11
+ const t = await fetch(`${this.baseUrl}/runtimes`, {
12
+ method: "GET",
13
+ headers: {
14
+ "Content-Type": "application/json"
15
+ }
16
+ });
17
+ if (!t.ok)
18
+ throw new Error(`Failed to fetch runtimes: ${t.statusText}`);
19
+ const l = await t.json();
20
+ return G = l, l;
21
+ } catch (t) {
22
+ throw console.error("Failed to fetch runtimes:", t), t;
23
+ }
24
+ }
25
+ async execute(e, t, l = {}) {
26
+ const p = (await this.getRuntimes()).find(
27
+ (h) => {
28
+ var S;
29
+ return h.language.toLowerCase() === e.toLowerCase() || ((S = h.aliases) == null ? void 0 : S.some((I) => I.toLowerCase() === e.toLowerCase()));
30
+ }
31
+ );
32
+ if (!p)
33
+ throw new Error(`Language '${e}' is not supported`);
34
+ const f = this.getFileName(e), b = {
35
+ language: p.language,
36
+ version: l.version || p.version,
37
+ files: [
38
+ {
39
+ name: f,
40
+ content: t
41
+ }
42
+ ],
43
+ stdin: l.stdin || "",
44
+ args: l.args || [],
45
+ run_timeout: l.runTimeout || this.timeout,
46
+ compile_timeout: this.timeout
47
+ }, u = Date.now();
48
+ try {
49
+ const h = await fetch(`${this.baseUrl}/execute`, {
50
+ method: "POST",
51
+ headers: {
52
+ "Content-Type": "application/json"
53
+ },
54
+ body: JSON.stringify(b)
55
+ });
56
+ if (!h.ok)
57
+ throw new Error(`Execute failed: ${h.statusText}`);
58
+ const S = await h.json(), I = Date.now() - u, L = S.run.stdout || "", F = S.run.stderr || "";
59
+ return {
60
+ success: S.run.code === 0,
61
+ output: L,
62
+ stderr: F,
63
+ code: S.run.code,
64
+ executionTime: I,
65
+ compile: S.compile ? {
66
+ stdout: S.compile.stdout || "",
67
+ stderr: S.compile.stderr || "",
68
+ code: S.compile.code
69
+ } : void 0
70
+ };
71
+ } catch (h) {
72
+ return {
73
+ success: !1,
74
+ output: "",
75
+ stderr: h instanceof Error ? h.message : "Unknown error",
76
+ code: -1,
77
+ executionTime: Date.now() - u
78
+ };
79
+ }
80
+ }
81
+ getFileName(e) {
82
+ return {
83
+ javascript: "main.js",
84
+ typescript: "main.ts",
85
+ python: "main.py",
86
+ python3: "main.py",
87
+ go: "main.go",
88
+ rust: "main.rs",
89
+ java: "Main.java",
90
+ c: "main.c",
91
+ cpp: "main.cpp",
92
+ csharp: "Main.cs",
93
+ ruby: "main.rb",
94
+ php: "main.php",
95
+ bash: "main.sh",
96
+ shell: "main.sh",
97
+ perl: "main.pl",
98
+ lua: "main.lua",
99
+ swift: "main.swift",
100
+ kotlin: "Main.kt",
101
+ scala: "Main.scala",
102
+ haskell: "main.hs",
103
+ dart: "main.dart",
104
+ html: "index.html",
105
+ css: "style.css",
106
+ sql: "query.sql",
107
+ markdown: "readme.md"
108
+ }[e.toLowerCase()] || `main.${e}`;
109
+ }
110
+ }
111
+ const le = {
112
+ javascript: 'console.log("Hello, World!");',
113
+ typescript: 'console.log("Hello, World!");',
114
+ python: 'print("Hello, World!")',
115
+ python3: 'print("Hello, World!")',
116
+ go: `package main
117
+
118
+ import "fmt"
119
+
120
+ func main() {
121
+ fmt.Println("Hello, World!")
122
+ }`,
123
+ rust: `fn main() {
124
+ println!("Hello, World!");
125
+ }`,
126
+ java: `public class Main {
127
+ public static void main(String[] args) {
128
+ System.out.println("Hello, World!");
129
+ }
130
+ }`,
131
+ c: `#include <stdio.h>
132
+
133
+ int main() {
134
+ printf("Hello, World!\\n");
135
+ return 0;
136
+ }`,
137
+ cpp: `#include <iostream>
138
+
139
+ int main() {
140
+ std::cout << "Hello, World!" << std::endl;
141
+ return 0;
142
+ }`,
143
+ csharp: `using System;
144
+
145
+ class Main {
146
+ static void Main() {
147
+ Console.WriteLine("Hello, World!");
148
+ }
149
+ }`,
150
+ ruby: 'puts "Hello, World!"',
151
+ php: `<?php
152
+ echo "Hello, World!";
153
+ ?>`,
154
+ bash: 'echo "Hello, World!"',
155
+ shell: 'echo "Hello, World!"',
156
+ perl: 'print "Hello, World!\\n";',
157
+ lua: 'print("Hello, World!")',
158
+ r: 'print("Hello, World!")',
159
+ swift: 'print("Hello, World!")',
160
+ kotlin: `fun main() {
161
+ println("Hello, World!")
162
+ }`,
163
+ scala: `object Main extends App {
164
+ println("Hello, World!")
165
+ }`,
166
+ haskell: 'main = putStrLn "Hello, World!"',
167
+ elixir: 'IO.puts "Hello, World!"',
168
+ erlang: 'main() -> io:fwrite("Hello, World!~n").',
169
+ clojure: '(println "Hello, World!")',
170
+ fsharp: 'printfn "Hello, World!"',
171
+ dart: `void main() {
172
+ print("Hello, World!");
173
+ }`,
174
+ assembly: `section .data
175
+ msg db 'Hello, World!', 0
176
+ section .text
177
+ global _start
178
+ _start:
179
+ mov rax, 1
180
+ mov rdi, 1
181
+ mov rsi, msg
182
+ mov rdx, 13
183
+ syscall
184
+ mov rax, 60
185
+ xor rdi, rdi
186
+ syscall`,
187
+ html: `<!DOCTYPE html>
188
+ <html>
189
+ <head>
190
+ <title>Hello</title>
191
+ </head>
192
+ <body>
193
+ <h1>Hello, World!</h1>
194
+ </body>
195
+ </html>`,
196
+ css: `body {
197
+ background-color: #f0f0f0;
198
+ font-family: Arial, sans-serif;
199
+ }
200
+
201
+ h1 {
202
+ color: #333;
203
+ }`,
204
+ sql: "SELECT 'Hello, World!' AS message;",
205
+ markdown: `# Hello, World!
206
+
207
+ This is a sample markdown document.`
208
+ };
209
+ function z(r) {
210
+ const e = r.toLowerCase();
211
+ return le[e] || `// ${r}
212
+ // Write your code here`;
213
+ }
214
+ var q = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
215
+ function ue(r) {
216
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
217
+ }
218
+ var Q = { exports: {} };
219
+ (function(r) {
220
+ var e = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
221
+ /**
222
+ * Prism: Lightweight, robust, elegant syntax highlighting
223
+ *
224
+ * @license MIT <https://opensource.org/licenses/MIT>
225
+ * @author Lea Verou <https://lea.verou.me>
226
+ * @namespace
227
+ * @public
228
+ */
229
+ var t = function(l) {
230
+ var p = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, f = 0, b = {}, u = {
231
+ /**
232
+ * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
233
+ * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
234
+ * additional languages or plugins yourself.
235
+ *
236
+ * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
237
+ *
238
+ * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
239
+ * empty Prism object into the global scope before loading the Prism script like this:
240
+ *
241
+ * ```js
242
+ * window.Prism = window.Prism || {};
243
+ * Prism.manual = true;
244
+ * // add a new <script> to load Prism's script
245
+ * ```
246
+ *
247
+ * @default false
248
+ * @type {boolean}
249
+ * @memberof Prism
250
+ * @public
251
+ */
252
+ manual: l.Prism && l.Prism.manual,
253
+ /**
254
+ * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
255
+ * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
256
+ * own worker, you don't want it to do this.
257
+ *
258
+ * By setting this value to `true`, Prism will not add its own listeners to the worker.
259
+ *
260
+ * You obviously have to change this value before Prism executes. To do this, you can add an
261
+ * empty Prism object into the global scope before loading the Prism script like this:
262
+ *
263
+ * ```js
264
+ * window.Prism = window.Prism || {};
265
+ * Prism.disableWorkerMessageHandler = true;
266
+ * // Load Prism's script
267
+ * ```
268
+ *
269
+ * @default false
270
+ * @type {boolean}
271
+ * @memberof Prism
272
+ * @public
273
+ */
274
+ disableWorkerMessageHandler: l.Prism && l.Prism.disableWorkerMessageHandler,
275
+ /**
276
+ * A namespace for utility methods.
277
+ *
278
+ * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
279
+ * change or disappear at any time.
280
+ *
281
+ * @namespace
282
+ * @memberof Prism
283
+ */
284
+ util: {
285
+ encode: function a(n) {
286
+ return n instanceof h ? new h(n.type, a(n.content), n.alias) : Array.isArray(n) ? n.map(a) : n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
287
+ },
288
+ /**
289
+ * Returns the name of the type of the given value.
290
+ *
291
+ * @param {any} o
292
+ * @returns {string}
293
+ * @example
294
+ * type(null) === 'Null'
295
+ * type(undefined) === 'Undefined'
296
+ * type(123) === 'Number'
297
+ * type('foo') === 'String'
298
+ * type(true) === 'Boolean'
299
+ * type([1, 2]) === 'Array'
300
+ * type({}) === 'Object'
301
+ * type(String) === 'Function'
302
+ * type(/abc+/) === 'RegExp'
303
+ */
304
+ type: function(a) {
305
+ return Object.prototype.toString.call(a).slice(8, -1);
306
+ },
307
+ /**
308
+ * Returns a unique number for the given object. Later calls will still return the same number.
309
+ *
310
+ * @param {Object} obj
311
+ * @returns {number}
312
+ */
313
+ objId: function(a) {
314
+ return a.__id || Object.defineProperty(a, "__id", { value: ++f }), a.__id;
315
+ },
316
+ /**
317
+ * Creates a deep clone of the given object.
318
+ *
319
+ * The main intended use of this function is to clone language definitions.
320
+ *
321
+ * @param {T} o
322
+ * @param {Record<number, any>} [visited]
323
+ * @returns {T}
324
+ * @template T
325
+ */
326
+ clone: function a(n, s) {
327
+ s = s || {};
328
+ var i, o;
329
+ switch (u.util.type(n)) {
330
+ case "Object":
331
+ if (o = u.util.objId(n), s[o])
332
+ return s[o];
333
+ i = /** @type {Record<string, any>} */
334
+ {}, s[o] = i;
335
+ for (var d in n)
336
+ n.hasOwnProperty(d) && (i[d] = a(n[d], s));
337
+ return (
338
+ /** @type {any} */
339
+ i
340
+ );
341
+ case "Array":
342
+ return o = u.util.objId(n), s[o] ? s[o] : (i = [], s[o] = i, /** @type {Array} */
343
+ /** @type {any} */
344
+ n.forEach(function(g, c) {
345
+ i[c] = a(g, s);
346
+ }), /** @type {any} */
347
+ i);
348
+ default:
349
+ return n;
350
+ }
351
+ },
352
+ /**
353
+ * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
354
+ *
355
+ * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
356
+ *
357
+ * @param {Element} element
358
+ * @returns {string}
359
+ */
360
+ getLanguage: function(a) {
361
+ for (; a; ) {
362
+ var n = p.exec(a.className);
363
+ if (n)
364
+ return n[1].toLowerCase();
365
+ a = a.parentElement;
366
+ }
367
+ return "none";
368
+ },
369
+ /**
370
+ * Sets the Prism `language-xxxx` class of the given element.
371
+ *
372
+ * @param {Element} element
373
+ * @param {string} language
374
+ * @returns {void}
375
+ */
376
+ setLanguage: function(a, n) {
377
+ a.className = a.className.replace(RegExp(p, "gi"), ""), a.classList.add("language-" + n);
378
+ },
379
+ /**
380
+ * Returns the script element that is currently executing.
381
+ *
382
+ * This does __not__ work for line script element.
383
+ *
384
+ * @returns {HTMLScriptElement | null}
385
+ */
386
+ currentScript: function() {
387
+ if (typeof document > "u")
388
+ return null;
389
+ if (document.currentScript && document.currentScript.tagName === "SCRIPT")
390
+ return (
391
+ /** @type {any} */
392
+ document.currentScript
393
+ );
394
+ try {
395
+ throw new Error();
396
+ } catch (i) {
397
+ var a = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(i.stack) || [])[1];
398
+ if (a) {
399
+ var n = document.getElementsByTagName("script");
400
+ for (var s in n)
401
+ if (n[s].src == a)
402
+ return n[s];
403
+ }
404
+ return null;
405
+ }
406
+ },
407
+ /**
408
+ * Returns whether a given class is active for `element`.
409
+ *
410
+ * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
411
+ * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
412
+ * given class is just the given class with a `no-` prefix.
413
+ *
414
+ * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
415
+ * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
416
+ * ancestors have the given class or the negated version of it, then the default activation will be returned.
417
+ *
418
+ * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
419
+ * version of it, the class is considered active.
420
+ *
421
+ * @param {Element} element
422
+ * @param {string} className
423
+ * @param {boolean} [defaultActivation=false]
424
+ * @returns {boolean}
425
+ */
426
+ isActive: function(a, n, s) {
427
+ for (var i = "no-" + n; a; ) {
428
+ var o = a.classList;
429
+ if (o.contains(n))
430
+ return !0;
431
+ if (o.contains(i))
432
+ return !1;
433
+ a = a.parentElement;
434
+ }
435
+ return !!s;
436
+ }
437
+ },
438
+ /**
439
+ * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
440
+ *
441
+ * @namespace
442
+ * @memberof Prism
443
+ * @public
444
+ */
445
+ languages: {
446
+ /**
447
+ * The grammar for plain, unformatted text.
448
+ */
449
+ plain: b,
450
+ plaintext: b,
451
+ text: b,
452
+ txt: b,
453
+ /**
454
+ * Creates a deep copy of the language with the given id and appends the given tokens.
455
+ *
456
+ * If a token in `redef` also appears in the copied language, then the existing token in the copied language
457
+ * will be overwritten at its original position.
458
+ *
459
+ * ## Best practices
460
+ *
461
+ * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
462
+ * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
463
+ * understand the language definition because, normally, the order of tokens matters in Prism grammars.
464
+ *
465
+ * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
466
+ * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
467
+ *
468
+ * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
469
+ * @param {Grammar} redef The new tokens to append.
470
+ * @returns {Grammar} The new language created.
471
+ * @public
472
+ * @example
473
+ * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
474
+ * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
475
+ * // at its original position
476
+ * 'comment': { ... },
477
+ * // CSS doesn't have a 'color' token, so this token will be appended
478
+ * 'color': /\b(?:red|green|blue)\b/
479
+ * });
480
+ */
481
+ extend: function(a, n) {
482
+ var s = u.util.clone(u.languages[a]);
483
+ for (var i in n)
484
+ s[i] = n[i];
485
+ return s;
486
+ },
487
+ /**
488
+ * Inserts tokens _before_ another token in a language definition or any other grammar.
489
+ *
490
+ * ## Usage
491
+ *
492
+ * This helper method makes it easy to modify existing languages. For example, the CSS language definition
493
+ * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
494
+ * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
495
+ * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
496
+ * this:
497
+ *
498
+ * ```js
499
+ * Prism.languages.markup.style = {
500
+ * // token
501
+ * };
502
+ * ```
503
+ *
504
+ * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
505
+ * before existing tokens. For the CSS example above, you would use it like this:
506
+ *
507
+ * ```js
508
+ * Prism.languages.insertBefore('markup', 'cdata', {
509
+ * 'style': {
510
+ * // token
511
+ * }
512
+ * });
513
+ * ```
514
+ *
515
+ * ## Special cases
516
+ *
517
+ * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
518
+ * will be ignored.
519
+ *
520
+ * This behavior can be used to insert tokens after `before`:
521
+ *
522
+ * ```js
523
+ * Prism.languages.insertBefore('markup', 'comment', {
524
+ * 'comment': Prism.languages.markup.comment,
525
+ * // tokens after 'comment'
526
+ * });
527
+ * ```
528
+ *
529
+ * ## Limitations
530
+ *
531
+ * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
532
+ * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
533
+ * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
534
+ * deleting properties which is necessary to insert at arbitrary positions.
535
+ *
536
+ * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
537
+ * Instead, it will create a new object and replace all references to the target object with the new one. This
538
+ * can be done without temporarily deleting properties, so the iteration order is well-defined.
539
+ *
540
+ * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
541
+ * you hold the target object in a variable, then the value of the variable will not change.
542
+ *
543
+ * ```js
544
+ * var oldMarkup = Prism.languages.markup;
545
+ * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
546
+ *
547
+ * assert(oldMarkup !== Prism.languages.markup);
548
+ * assert(newMarkup === Prism.languages.markup);
549
+ * ```
550
+ *
551
+ * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
552
+ * object to be modified.
553
+ * @param {string} before The key to insert before.
554
+ * @param {Grammar} insert An object containing the key-value pairs to be inserted.
555
+ * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
556
+ * object to be modified.
557
+ *
558
+ * Defaults to `Prism.languages`.
559
+ * @returns {Grammar} The new grammar object.
560
+ * @public
561
+ */
562
+ insertBefore: function(a, n, s, i) {
563
+ i = i || /** @type {any} */
564
+ u.languages;
565
+ var o = i[a], d = {};
566
+ for (var g in o)
567
+ if (o.hasOwnProperty(g)) {
568
+ if (g == n)
569
+ for (var c in s)
570
+ s.hasOwnProperty(c) && (d[c] = s[c]);
571
+ s.hasOwnProperty(g) || (d[g] = o[g]);
572
+ }
573
+ var E = i[a];
574
+ return i[a] = d, u.languages.DFS(u.languages, function(y, R) {
575
+ R === E && y != a && (this[y] = d);
576
+ }), d;
577
+ },
578
+ // Traverse a language definition with Depth First Search
579
+ DFS: function a(n, s, i, o) {
580
+ o = o || {};
581
+ var d = u.util.objId;
582
+ for (var g in n)
583
+ if (n.hasOwnProperty(g)) {
584
+ s.call(n, g, n[g], i || g);
585
+ var c = n[g], E = u.util.type(c);
586
+ E === "Object" && !o[d(c)] ? (o[d(c)] = !0, a(c, s, null, o)) : E === "Array" && !o[d(c)] && (o[d(c)] = !0, a(c, s, g, o));
587
+ }
588
+ }
589
+ },
590
+ plugins: {},
591
+ /**
592
+ * This is the most high-level function in Prism’s API.
593
+ * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
594
+ * each one of them.
595
+ *
596
+ * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
597
+ *
598
+ * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
599
+ * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
600
+ * @memberof Prism
601
+ * @public
602
+ */
603
+ highlightAll: function(a, n) {
604
+ u.highlightAllUnder(document, a, n);
605
+ },
606
+ /**
607
+ * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
608
+ * {@link Prism.highlightElement} on each one of them.
609
+ *
610
+ * The following hooks will be run:
611
+ * 1. `before-highlightall`
612
+ * 2. `before-all-elements-highlight`
613
+ * 3. All hooks of {@link Prism.highlightElement} for each element.
614
+ *
615
+ * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
616
+ * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
617
+ * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
618
+ * @memberof Prism
619
+ * @public
620
+ */
621
+ highlightAllUnder: function(a, n, s) {
622
+ var i = {
623
+ callback: s,
624
+ container: a,
625
+ selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
626
+ };
627
+ u.hooks.run("before-highlightall", i), i.elements = Array.prototype.slice.apply(i.container.querySelectorAll(i.selector)), u.hooks.run("before-all-elements-highlight", i);
628
+ for (var o = 0, d; d = i.elements[o++]; )
629
+ u.highlightElement(d, n === !0, i.callback);
630
+ },
631
+ /**
632
+ * Highlights the code inside a single element.
633
+ *
634
+ * The following hooks will be run:
635
+ * 1. `before-sanity-check`
636
+ * 2. `before-highlight`
637
+ * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
638
+ * 4. `before-insert`
639
+ * 5. `after-highlight`
640
+ * 6. `complete`
641
+ *
642
+ * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
643
+ * the element's language.
644
+ *
645
+ * @param {Element} element The element containing the code.
646
+ * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
647
+ * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
648
+ * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
649
+ * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
650
+ *
651
+ * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
652
+ * asynchronous highlighting to work. You can build your own bundle on the
653
+ * [Download page](https://prismjs.com/download.html).
654
+ * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
655
+ * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
656
+ * @memberof Prism
657
+ * @public
658
+ */
659
+ highlightElement: function(a, n, s) {
660
+ var i = u.util.getLanguage(a), o = u.languages[i];
661
+ u.util.setLanguage(a, i);
662
+ var d = a.parentElement;
663
+ d && d.nodeName.toLowerCase() === "pre" && u.util.setLanguage(d, i);
664
+ var g = a.textContent, c = {
665
+ element: a,
666
+ language: i,
667
+ grammar: o,
668
+ code: g
669
+ };
670
+ function E(R) {
671
+ c.highlightedCode = R, u.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, u.hooks.run("after-highlight", c), u.hooks.run("complete", c), s && s.call(c.element);
672
+ }
673
+ if (u.hooks.run("before-sanity-check", c), d = c.element.parentElement, d && d.nodeName.toLowerCase() === "pre" && !d.hasAttribute("tabindex") && d.setAttribute("tabindex", "0"), !c.code) {
674
+ u.hooks.run("complete", c), s && s.call(c.element);
675
+ return;
676
+ }
677
+ if (u.hooks.run("before-highlight", c), !c.grammar) {
678
+ E(u.util.encode(c.code));
679
+ return;
680
+ }
681
+ if (n && l.Worker) {
682
+ var y = new Worker(u.filename);
683
+ y.onmessage = function(R) {
684
+ E(R.data);
685
+ }, y.postMessage(JSON.stringify({
686
+ language: c.language,
687
+ code: c.code,
688
+ immediateClose: !0
689
+ }));
690
+ } else
691
+ E(u.highlight(c.code, c.grammar, c.language));
692
+ },
693
+ /**
694
+ * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
695
+ * and the language definitions to use, and returns a string with the HTML produced.
696
+ *
697
+ * The following hooks will be run:
698
+ * 1. `before-tokenize`
699
+ * 2. `after-tokenize`
700
+ * 3. `wrap`: On each {@link Token}.
701
+ *
702
+ * @param {string} text A string with the code to be highlighted.
703
+ * @param {Grammar} grammar An object containing the tokens to use.
704
+ *
705
+ * Usually a language definition like `Prism.languages.markup`.
706
+ * @param {string} language The name of the language definition passed to `grammar`.
707
+ * @returns {string} The highlighted HTML.
708
+ * @memberof Prism
709
+ * @public
710
+ * @example
711
+ * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
712
+ */
713
+ highlight: function(a, n, s) {
714
+ var i = {
715
+ code: a,
716
+ grammar: n,
717
+ language: s
718
+ };
719
+ if (u.hooks.run("before-tokenize", i), !i.grammar)
720
+ throw new Error('The language "' + i.language + '" has no grammar.');
721
+ return i.tokens = u.tokenize(i.code, i.grammar), u.hooks.run("after-tokenize", i), h.stringify(u.util.encode(i.tokens), i.language);
722
+ },
723
+ /**
724
+ * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
725
+ * and the language definitions to use, and returns an array with the tokenized code.
726
+ *
727
+ * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
728
+ *
729
+ * This method could be useful in other contexts as well, as a very crude parser.
730
+ *
731
+ * @param {string} text A string with the code to be highlighted.
732
+ * @param {Grammar} grammar An object containing the tokens to use.
733
+ *
734
+ * Usually a language definition like `Prism.languages.markup`.
735
+ * @returns {TokenStream} An array of strings and tokens, a token stream.
736
+ * @memberof Prism
737
+ * @public
738
+ * @example
739
+ * let code = `var foo = 0;`;
740
+ * let tokens = Prism.tokenize(code, Prism.languages.javascript);
741
+ * tokens.forEach(token => {
742
+ * if (token instanceof Prism.Token && token.type === 'number') {
743
+ * console.log(`Found numeric literal: ${token.content}`);
744
+ * }
745
+ * });
746
+ */
747
+ tokenize: function(a, n) {
748
+ var s = n.rest;
749
+ if (s) {
750
+ for (var i in s)
751
+ n[i] = s[i];
752
+ delete n.rest;
753
+ }
754
+ var o = new L();
755
+ return F(o, o.head, a), I(a, o, n, o.head, 0), N(o);
756
+ },
757
+ /**
758
+ * @namespace
759
+ * @memberof Prism
760
+ * @public
761
+ */
762
+ hooks: {
763
+ all: {},
764
+ /**
765
+ * Adds the given callback to the list of callbacks for the given hook.
766
+ *
767
+ * The callback will be invoked when the hook it is registered for is run.
768
+ * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
769
+ *
770
+ * One callback function can be registered to multiple hooks and the same hook multiple times.
771
+ *
772
+ * @param {string} name The name of the hook.
773
+ * @param {HookCallback} callback The callback function which is given environment variables.
774
+ * @public
775
+ */
776
+ add: function(a, n) {
777
+ var s = u.hooks.all;
778
+ s[a] = s[a] || [], s[a].push(n);
779
+ },
780
+ /**
781
+ * Runs a hook invoking all registered callbacks with the given environment variables.
782
+ *
783
+ * Callbacks will be invoked synchronously and in the order in which they were registered.
784
+ *
785
+ * @param {string} name The name of the hook.
786
+ * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
787
+ * @public
788
+ */
789
+ run: function(a, n) {
790
+ var s = u.hooks.all[a];
791
+ if (!(!s || !s.length))
792
+ for (var i = 0, o; o = s[i++]; )
793
+ o(n);
794
+ }
795
+ },
796
+ Token: h
797
+ };
798
+ l.Prism = u;
799
+ function h(a, n, s, i) {
800
+ this.type = a, this.content = n, this.alias = s, this.length = (i || "").length | 0;
801
+ }
802
+ h.stringify = function a(n, s) {
803
+ if (typeof n == "string")
804
+ return n;
805
+ if (Array.isArray(n)) {
806
+ var i = "";
807
+ return n.forEach(function(E) {
808
+ i += a(E, s);
809
+ }), i;
810
+ }
811
+ var o = {
812
+ type: n.type,
813
+ content: a(n.content, s),
814
+ tag: "span",
815
+ classes: ["token", n.type],
816
+ attributes: {},
817
+ language: s
818
+ }, d = n.alias;
819
+ d && (Array.isArray(d) ? Array.prototype.push.apply(o.classes, d) : o.classes.push(d)), u.hooks.run("wrap", o);
820
+ var g = "";
821
+ for (var c in o.attributes)
822
+ g += " " + c + '="' + (o.attributes[c] || "").replace(/"/g, "&quot;") + '"';
823
+ return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' + g + ">" + o.content + "</" + o.tag + ">";
824
+ };
825
+ function S(a, n, s, i) {
826
+ a.lastIndex = n;
827
+ var o = a.exec(s);
828
+ if (o && i && o[1]) {
829
+ var d = o[1].length;
830
+ o.index += d, o[0] = o[0].slice(d);
831
+ }
832
+ return o;
833
+ }
834
+ function I(a, n, s, i, o, d) {
835
+ for (var g in s)
836
+ if (!(!s.hasOwnProperty(g) || !s[g])) {
837
+ var c = s[g];
838
+ c = Array.isArray(c) ? c : [c];
839
+ for (var E = 0; E < c.length; ++E) {
840
+ if (d && d.cause == g + "," + E)
841
+ return;
842
+ var y = c[E], R = y.inside, Y = !!y.lookbehind, X = !!y.greedy, te = y.alias;
843
+ if (X && !y.pattern.global) {
844
+ var ne = y.pattern.toString().match(/[imsuy]*$/)[0];
845
+ y.pattern = RegExp(y.pattern.source, ne + "g");
846
+ }
847
+ for (var Z = y.pattern || y, T = i.next, _ = o; T !== n.tail && !(d && _ >= d.reach); _ += T.value.length, T = T.next) {
848
+ var x = T.value;
849
+ if (n.length > a.length)
850
+ return;
851
+ if (!(x instanceof h)) {
852
+ var C = 1, w;
853
+ if (X) {
854
+ if (w = S(Z, _, a, Y), !w || w.index >= a.length)
855
+ break;
856
+ var D = w.index, ae = w.index + w[0].length, k = _;
857
+ for (k += T.value.length; D >= k; )
858
+ T = T.next, k += T.value.length;
859
+ if (k -= T.value.length, _ = k, T.value instanceof h)
860
+ continue;
861
+ for (var O = T; O !== n.tail && (k < ae || typeof O.value == "string"); O = O.next)
862
+ C++, k += O.value.length;
863
+ C--, x = a.slice(_, k), w.index -= _;
864
+ } else if (w = S(Z, 0, x, Y), !w)
865
+ continue;
866
+ var D = w.index, P = w[0], U = x.slice(0, D), K = x.slice(D + P.length), H = _ + x.length;
867
+ d && H > d.reach && (d.reach = H);
868
+ var $ = T.prev;
869
+ U && ($ = F(n, $, U), _ += U.length), M(n, $, C);
870
+ var re = new h(g, R ? u.tokenize(P, R) : P, te, P);
871
+ if (T = F(n, $, re), K && F(n, T, K), C > 1) {
872
+ var B = {
873
+ cause: g + "," + E,
874
+ reach: H
875
+ };
876
+ I(a, n, s, T.prev, _, B), d && B.reach > d.reach && (d.reach = B.reach);
877
+ }
878
+ }
879
+ }
880
+ }
881
+ }
882
+ }
883
+ function L() {
884
+ var a = { value: null, prev: null, next: null }, n = { value: null, prev: a, next: null };
885
+ a.next = n, this.head = a, this.tail = n, this.length = 0;
886
+ }
887
+ function F(a, n, s) {
888
+ var i = n.next, o = { value: s, prev: n, next: i };
889
+ return n.next = o, i.prev = o, a.length++, o;
890
+ }
891
+ function M(a, n, s) {
892
+ for (var i = n.next, o = 0; o < s && i !== a.tail; o++)
893
+ i = i.next;
894
+ n.next = i, i.prev = n, a.length -= o;
895
+ }
896
+ function N(a) {
897
+ for (var n = [], s = a.head.next; s !== a.tail; )
898
+ n.push(s.value), s = s.next;
899
+ return n;
900
+ }
901
+ if (!l.document)
902
+ return l.addEventListener && (u.disableWorkerMessageHandler || l.addEventListener("message", function(a) {
903
+ var n = JSON.parse(a.data), s = n.language, i = n.code, o = n.immediateClose;
904
+ l.postMessage(u.highlight(i, u.languages[s], s)), o && l.close();
905
+ }, !1)), u;
906
+ var v = u.util.currentScript();
907
+ v && (u.filename = v.src, v.hasAttribute("data-manual") && (u.manual = !0));
908
+ function m() {
909
+ u.manual || u.highlightAll();
910
+ }
911
+ if (!u.manual) {
912
+ var A = document.readyState;
913
+ A === "loading" || A === "interactive" && v && v.defer ? document.addEventListener("DOMContentLoaded", m) : window.requestAnimationFrame ? window.requestAnimationFrame(m) : window.setTimeout(m, 16);
914
+ }
915
+ return u;
916
+ }(e);
917
+ r.exports && (r.exports = t), typeof q < "u" && (q.Prism = t), t.languages.markup = {
918
+ comment: {
919
+ pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
920
+ greedy: !0
921
+ },
922
+ prolog: {
923
+ pattern: /<\?[\s\S]+?\?>/,
924
+ greedy: !0
925
+ },
926
+ doctype: {
927
+ // https://www.w3.org/TR/xml/#NT-doctypedecl
928
+ pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
929
+ greedy: !0,
930
+ inside: {
931
+ "internal-subset": {
932
+ pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
933
+ lookbehind: !0,
934
+ greedy: !0,
935
+ inside: null
936
+ // see below
937
+ },
938
+ string: {
939
+ pattern: /"[^"]*"|'[^']*'/,
940
+ greedy: !0
941
+ },
942
+ punctuation: /^<!|>$|[[\]]/,
943
+ "doctype-tag": /^DOCTYPE/i,
944
+ name: /[^\s<>'"]+/
945
+ }
946
+ },
947
+ cdata: {
948
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
949
+ greedy: !0
950
+ },
951
+ tag: {
952
+ pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
953
+ greedy: !0,
954
+ inside: {
955
+ tag: {
956
+ pattern: /^<\/?[^\s>\/]+/,
957
+ inside: {
958
+ punctuation: /^<\/?/,
959
+ namespace: /^[^\s>\/:]+:/
960
+ }
961
+ },
962
+ "special-attr": [],
963
+ "attr-value": {
964
+ pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
965
+ inside: {
966
+ punctuation: [
967
+ {
968
+ pattern: /^=/,
969
+ alias: "attr-equals"
970
+ },
971
+ {
972
+ pattern: /^(\s*)["']|["']$/,
973
+ lookbehind: !0
974
+ }
975
+ ]
976
+ }
977
+ },
978
+ punctuation: /\/?>/,
979
+ "attr-name": {
980
+ pattern: /[^\s>\/]+/,
981
+ inside: {
982
+ namespace: /^[^\s>\/:]+:/
983
+ }
984
+ }
985
+ }
986
+ },
987
+ entity: [
988
+ {
989
+ pattern: /&[\da-z]{1,8};/i,
990
+ alias: "named-entity"
991
+ },
992
+ /&#x?[\da-f]{1,8};/i
993
+ ]
994
+ }, t.languages.markup.tag.inside["attr-value"].inside.entity = t.languages.markup.entity, t.languages.markup.doctype.inside["internal-subset"].inside = t.languages.markup, t.hooks.add("wrap", function(l) {
995
+ l.type === "entity" && (l.attributes.title = l.content.replace(/&amp;/, "&"));
996
+ }), Object.defineProperty(t.languages.markup.tag, "addInlined", {
997
+ /**
998
+ * Adds an inlined language to markup.
999
+ *
1000
+ * An example of an inlined language is CSS with `<style>` tags.
1001
+ *
1002
+ * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
1003
+ * case insensitive.
1004
+ * @param {string} lang The language key.
1005
+ * @example
1006
+ * addInlined('style', 'css');
1007
+ */
1008
+ value: function(p, f) {
1009
+ var b = {};
1010
+ b["language-" + f] = {
1011
+ pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1012
+ lookbehind: !0,
1013
+ inside: t.languages[f]
1014
+ }, b.cdata = /^<!\[CDATA\[|\]\]>$/i;
1015
+ var u = {
1016
+ "included-cdata": {
1017
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1018
+ inside: b
1019
+ }
1020
+ };
1021
+ u["language-" + f] = {
1022
+ pattern: /[\s\S]+/,
1023
+ inside: t.languages[f]
1024
+ };
1025
+ var h = {};
1026
+ h[p] = {
1027
+ pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
1028
+ return p;
1029
+ }), "i"),
1030
+ lookbehind: !0,
1031
+ greedy: !0,
1032
+ inside: u
1033
+ }, t.languages.insertBefore("markup", "cdata", h);
1034
+ }
1035
+ }), Object.defineProperty(t.languages.markup.tag, "addAttribute", {
1036
+ /**
1037
+ * Adds an pattern to highlight languages embedded in HTML attributes.
1038
+ *
1039
+ * An example of an inlined language is CSS with `style` attributes.
1040
+ *
1041
+ * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
1042
+ * case insensitive.
1043
+ * @param {string} lang The language key.
1044
+ * @example
1045
+ * addAttribute('style', 'css');
1046
+ */
1047
+ value: function(l, p) {
1048
+ t.languages.markup.tag.inside["special-attr"].push({
1049
+ pattern: RegExp(
1050
+ /(^|["'\s])/.source + "(?:" + l + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1051
+ "i"
1052
+ ),
1053
+ lookbehind: !0,
1054
+ inside: {
1055
+ "attr-name": /^[^\s=]+/,
1056
+ "attr-value": {
1057
+ pattern: /=[\s\S]+/,
1058
+ inside: {
1059
+ value: {
1060
+ pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1061
+ lookbehind: !0,
1062
+ alias: [p, "language-" + p],
1063
+ inside: t.languages[p]
1064
+ },
1065
+ punctuation: [
1066
+ {
1067
+ pattern: /^=/,
1068
+ alias: "attr-equals"
1069
+ },
1070
+ /"|'/
1071
+ ]
1072
+ }
1073
+ }
1074
+ }
1075
+ });
1076
+ }
1077
+ }), t.languages.html = t.languages.markup, t.languages.mathml = t.languages.markup, t.languages.svg = t.languages.markup, t.languages.xml = t.languages.extend("markup", {}), t.languages.ssml = t.languages.xml, t.languages.atom = t.languages.xml, t.languages.rss = t.languages.xml, function(l) {
1078
+ var p = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1079
+ l.languages.css = {
1080
+ comment: /\/\*[\s\S]*?\*\//,
1081
+ atrule: {
1082
+ pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + p.source + ")*?" + /(?:;|(?=\s*\{))/.source),
1083
+ inside: {
1084
+ rule: /^@[\w-]+/,
1085
+ "selector-function-argument": {
1086
+ pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1087
+ lookbehind: !0,
1088
+ alias: "selector"
1089
+ },
1090
+ keyword: {
1091
+ pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1092
+ lookbehind: !0
1093
+ }
1094
+ // See rest below
1095
+ }
1096
+ },
1097
+ url: {
1098
+ // https://drafts.csswg.org/css-values-3/#urls
1099
+ pattern: RegExp("\\burl\\((?:" + p.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
1100
+ greedy: !0,
1101
+ inside: {
1102
+ function: /^url/i,
1103
+ punctuation: /^\(|\)$/,
1104
+ string: {
1105
+ pattern: RegExp("^" + p.source + "$"),
1106
+ alias: "url"
1107
+ }
1108
+ }
1109
+ },
1110
+ selector: {
1111
+ pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + p.source + ")*(?=\\s*\\{)"),
1112
+ lookbehind: !0
1113
+ },
1114
+ string: {
1115
+ pattern: p,
1116
+ greedy: !0
1117
+ },
1118
+ property: {
1119
+ pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1120
+ lookbehind: !0
1121
+ },
1122
+ important: /!important\b/i,
1123
+ function: {
1124
+ pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1125
+ lookbehind: !0
1126
+ },
1127
+ punctuation: /[(){};:,]/
1128
+ }, l.languages.css.atrule.inside.rest = l.languages.css;
1129
+ var f = l.languages.markup;
1130
+ f && (f.tag.addInlined("style", "css"), f.tag.addAttribute("style", "css"));
1131
+ }(t), t.languages.clike = {
1132
+ comment: [
1133
+ {
1134
+ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1135
+ lookbehind: !0,
1136
+ greedy: !0
1137
+ },
1138
+ {
1139
+ pattern: /(^|[^\\:])\/\/.*/,
1140
+ lookbehind: !0,
1141
+ greedy: !0
1142
+ }
1143
+ ],
1144
+ string: {
1145
+ pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1146
+ greedy: !0
1147
+ },
1148
+ "class-name": {
1149
+ pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
1150
+ lookbehind: !0,
1151
+ inside: {
1152
+ punctuation: /[.\\]/
1153
+ }
1154
+ },
1155
+ keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
1156
+ boolean: /\b(?:false|true)\b/,
1157
+ function: /\b\w+(?=\()/,
1158
+ number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1159
+ operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1160
+ punctuation: /[{}[\];(),.:]/
1161
+ }, t.languages.javascript = t.languages.extend("clike", {
1162
+ "class-name": [
1163
+ t.languages.clike["class-name"],
1164
+ {
1165
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1166
+ lookbehind: !0
1167
+ }
1168
+ ],
1169
+ keyword: [
1170
+ {
1171
+ pattern: /((?:^|\})\s*)catch\b/,
1172
+ lookbehind: !0
1173
+ },
1174
+ {
1175
+ pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
1176
+ lookbehind: !0
1177
+ }
1178
+ ],
1179
+ // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1180
+ function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1181
+ number: {
1182
+ pattern: RegExp(
1183
+ /(^|[^\w$])/.source + "(?:" + // constant
1184
+ (/NaN|Infinity/.source + "|" + // binary integer
1185
+ /0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
1186
+ /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
1187
+ /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
1188
+ /\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
1189
+ /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
1190
+ ),
1191
+ lookbehind: !0
1192
+ },
1193
+ operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1194
+ }), t.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, t.languages.insertBefore("javascript", "keyword", {
1195
+ regex: {
1196
+ pattern: RegExp(
1197
+ // lookbehind
1198
+ // eslint-disable-next-line regexp/no-dupe-characters-character-class
1199
+ /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
1200
+ // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
1201
+ // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
1202
+ // with the only syntax, so we have to define 2 different regex patterns.
1203
+ /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
1204
+ /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
1205
+ /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
1206
+ ),
1207
+ lookbehind: !0,
1208
+ greedy: !0,
1209
+ inside: {
1210
+ "regex-source": {
1211
+ pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1212
+ lookbehind: !0,
1213
+ alias: "language-regex",
1214
+ inside: t.languages.regex
1215
+ },
1216
+ "regex-delimiter": /^\/|\/$/,
1217
+ "regex-flags": /^[a-z]+$/
1218
+ }
1219
+ },
1220
+ // This must be declared before keyword because we use "function" inside the look-forward
1221
+ "function-variable": {
1222
+ pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
1223
+ alias: "function"
1224
+ },
1225
+ parameter: [
1226
+ {
1227
+ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1228
+ lookbehind: !0,
1229
+ inside: t.languages.javascript
1230
+ },
1231
+ {
1232
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1233
+ lookbehind: !0,
1234
+ inside: t.languages.javascript
1235
+ },
1236
+ {
1237
+ pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1238
+ lookbehind: !0,
1239
+ inside: t.languages.javascript
1240
+ },
1241
+ {
1242
+ pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
1243
+ lookbehind: !0,
1244
+ inside: t.languages.javascript
1245
+ }
1246
+ ],
1247
+ constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1248
+ }), t.languages.insertBefore("javascript", "string", {
1249
+ hashbang: {
1250
+ pattern: /^#!.*/,
1251
+ greedy: !0,
1252
+ alias: "comment"
1253
+ },
1254
+ "template-string": {
1255
+ pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1256
+ greedy: !0,
1257
+ inside: {
1258
+ "template-punctuation": {
1259
+ pattern: /^`|`$/,
1260
+ alias: "string"
1261
+ },
1262
+ interpolation: {
1263
+ pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1264
+ lookbehind: !0,
1265
+ inside: {
1266
+ "interpolation-punctuation": {
1267
+ pattern: /^\$\{|\}$/,
1268
+ alias: "punctuation"
1269
+ },
1270
+ rest: t.languages.javascript
1271
+ }
1272
+ },
1273
+ string: /[\s\S]+/
1274
+ }
1275
+ },
1276
+ "string-property": {
1277
+ pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
1278
+ lookbehind: !0,
1279
+ greedy: !0,
1280
+ alias: "property"
1281
+ }
1282
+ }), t.languages.insertBefore("javascript", "operator", {
1283
+ "literal-property": {
1284
+ pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1285
+ lookbehind: !0,
1286
+ alias: "property"
1287
+ }
1288
+ }), t.languages.markup && (t.languages.markup.tag.addInlined("script", "javascript"), t.languages.markup.tag.addAttribute(
1289
+ /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
1290
+ "javascript"
1291
+ )), t.languages.js = t.languages.javascript, function() {
1292
+ if (typeof t > "u" || typeof document > "u")
1293
+ return;
1294
+ Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
1295
+ var l = "Loading…", p = function(v, m) {
1296
+ return "✖ Error " + v + " while fetching file: " + m;
1297
+ }, f = "✖ Error: File does not exist or is empty", b = {
1298
+ js: "javascript",
1299
+ py: "python",
1300
+ rb: "ruby",
1301
+ ps1: "powershell",
1302
+ psm1: "powershell",
1303
+ sh: "bash",
1304
+ bat: "batch",
1305
+ h: "c",
1306
+ tex: "latex"
1307
+ }, u = "data-src-status", h = "loading", S = "loaded", I = "failed", L = "pre[data-src]:not([" + u + '="' + S + '"]):not([' + u + '="' + h + '"])';
1308
+ function F(v, m, A) {
1309
+ var a = new XMLHttpRequest();
1310
+ a.open("GET", v, !0), a.onreadystatechange = function() {
1311
+ a.readyState == 4 && (a.status < 400 && a.responseText ? m(a.responseText) : a.status >= 400 ? A(p(a.status, a.statusText)) : A(f));
1312
+ }, a.send(null);
1313
+ }
1314
+ function M(v) {
1315
+ var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v || "");
1316
+ if (m) {
1317
+ var A = Number(m[1]), a = m[2], n = m[3];
1318
+ return a ? n ? [A, Number(n)] : [A, void 0] : [A, A];
1319
+ }
1320
+ }
1321
+ t.hooks.add("before-highlightall", function(v) {
1322
+ v.selector += ", " + L;
1323
+ }), t.hooks.add("before-sanity-check", function(v) {
1324
+ var m = (
1325
+ /** @type {HTMLPreElement} */
1326
+ v.element
1327
+ );
1328
+ if (m.matches(L)) {
1329
+ v.code = "", m.setAttribute(u, h);
1330
+ var A = m.appendChild(document.createElement("CODE"));
1331
+ A.textContent = l;
1332
+ var a = m.getAttribute("data-src"), n = v.language;
1333
+ if (n === "none") {
1334
+ var s = (/\.(\w+)$/.exec(a) || [, "none"])[1];
1335
+ n = b[s] || s;
1336
+ }
1337
+ t.util.setLanguage(A, n), t.util.setLanguage(m, n);
1338
+ var i = t.plugins.autoloader;
1339
+ i && i.loadLanguages(n), F(
1340
+ a,
1341
+ function(o) {
1342
+ m.setAttribute(u, S);
1343
+ var d = M(m.getAttribute("data-range"));
1344
+ if (d) {
1345
+ var g = o.split(/\r\n?|\n/g), c = d[0], E = d[1] == null ? g.length : d[1];
1346
+ c < 0 && (c += g.length), c = Math.max(0, Math.min(c - 1, g.length)), E < 0 && (E += g.length), E = Math.max(0, Math.min(E, g.length)), o = g.slice(c, E).join(`
1347
+ `), m.hasAttribute("data-start") || m.setAttribute("data-start", String(c + 1));
1348
+ }
1349
+ A.textContent = o, t.highlightElement(A);
1350
+ },
1351
+ function(o) {
1352
+ m.setAttribute(u, I), A.textContent = o;
1353
+ }
1354
+ );
1355
+ }
1356
+ }), t.plugins.fileHighlight = {
1357
+ /**
1358
+ * Executes the File Highlight plugin for all matching `pre` elements under the given container.
1359
+ *
1360
+ * Note: Elements which are already loaded or currently loading will not be touched by this method.
1361
+ *
1362
+ * @param {ParentNode} [container=document]
1363
+ */
1364
+ highlight: function(m) {
1365
+ for (var A = (m || document).querySelectorAll(L), a = 0, n; n = A[a++]; )
1366
+ t.highlightElement(n);
1367
+ }
1368
+ };
1369
+ var N = !1;
1370
+ t.fileHighlight = function() {
1371
+ N || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), N = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
1372
+ };
1373
+ }();
1374
+ })(Q);
1375
+ var ce = Q.exports;
1376
+ const j = /* @__PURE__ */ ue(ce);
1377
+ Prism.languages.clike = {
1378
+ comment: [
1379
+ {
1380
+ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1381
+ lookbehind: !0,
1382
+ greedy: !0
1383
+ },
1384
+ {
1385
+ pattern: /(^|[^\\:])\/\/.*/,
1386
+ lookbehind: !0,
1387
+ greedy: !0
1388
+ }
1389
+ ],
1390
+ string: {
1391
+ pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1392
+ greedy: !0
1393
+ },
1394
+ "class-name": {
1395
+ pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
1396
+ lookbehind: !0,
1397
+ inside: {
1398
+ punctuation: /[.\\]/
1399
+ }
1400
+ },
1401
+ keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
1402
+ boolean: /\b(?:false|true)\b/,
1403
+ function: /\b\w+(?=\()/,
1404
+ number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1405
+ operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1406
+ punctuation: /[{}[\];(),.:]/
1407
+ };
1408
+ Prism.languages.javascript = Prism.languages.extend("clike", {
1409
+ "class-name": [
1410
+ Prism.languages.clike["class-name"],
1411
+ {
1412
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1413
+ lookbehind: !0
1414
+ }
1415
+ ],
1416
+ keyword: [
1417
+ {
1418
+ pattern: /((?:^|\})\s*)catch\b/,
1419
+ lookbehind: !0
1420
+ },
1421
+ {
1422
+ pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
1423
+ lookbehind: !0
1424
+ }
1425
+ ],
1426
+ // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1427
+ function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1428
+ number: {
1429
+ pattern: RegExp(
1430
+ /(^|[^\w$])/.source + "(?:" + // constant
1431
+ (/NaN|Infinity/.source + "|" + // binary integer
1432
+ /0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
1433
+ /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
1434
+ /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
1435
+ /\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
1436
+ /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
1437
+ ),
1438
+ lookbehind: !0
1439
+ },
1440
+ operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1441
+ });
1442
+ Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
1443
+ Prism.languages.insertBefore("javascript", "keyword", {
1444
+ regex: {
1445
+ pattern: RegExp(
1446
+ // lookbehind
1447
+ // eslint-disable-next-line regexp/no-dupe-characters-character-class
1448
+ /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
1449
+ // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
1450
+ // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
1451
+ // with the only syntax, so we have to define 2 different regex patterns.
1452
+ /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
1453
+ /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
1454
+ /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
1455
+ ),
1456
+ lookbehind: !0,
1457
+ greedy: !0,
1458
+ inside: {
1459
+ "regex-source": {
1460
+ pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1461
+ lookbehind: !0,
1462
+ alias: "language-regex",
1463
+ inside: Prism.languages.regex
1464
+ },
1465
+ "regex-delimiter": /^\/|\/$/,
1466
+ "regex-flags": /^[a-z]+$/
1467
+ }
1468
+ },
1469
+ // This must be declared before keyword because we use "function" inside the look-forward
1470
+ "function-variable": {
1471
+ pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
1472
+ alias: "function"
1473
+ },
1474
+ parameter: [
1475
+ {
1476
+ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1477
+ lookbehind: !0,
1478
+ inside: Prism.languages.javascript
1479
+ },
1480
+ {
1481
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1482
+ lookbehind: !0,
1483
+ inside: Prism.languages.javascript
1484
+ },
1485
+ {
1486
+ pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1487
+ lookbehind: !0,
1488
+ inside: Prism.languages.javascript
1489
+ },
1490
+ {
1491
+ pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
1492
+ lookbehind: !0,
1493
+ inside: Prism.languages.javascript
1494
+ }
1495
+ ],
1496
+ constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1497
+ });
1498
+ Prism.languages.insertBefore("javascript", "string", {
1499
+ hashbang: {
1500
+ pattern: /^#!.*/,
1501
+ greedy: !0,
1502
+ alias: "comment"
1503
+ },
1504
+ "template-string": {
1505
+ pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1506
+ greedy: !0,
1507
+ inside: {
1508
+ "template-punctuation": {
1509
+ pattern: /^`|`$/,
1510
+ alias: "string"
1511
+ },
1512
+ interpolation: {
1513
+ pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1514
+ lookbehind: !0,
1515
+ inside: {
1516
+ "interpolation-punctuation": {
1517
+ pattern: /^\$\{|\}$/,
1518
+ alias: "punctuation"
1519
+ },
1520
+ rest: Prism.languages.javascript
1521
+ }
1522
+ },
1523
+ string: /[\s\S]+/
1524
+ }
1525
+ },
1526
+ "string-property": {
1527
+ pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
1528
+ lookbehind: !0,
1529
+ greedy: !0,
1530
+ alias: "property"
1531
+ }
1532
+ });
1533
+ Prism.languages.insertBefore("javascript", "operator", {
1534
+ "literal-property": {
1535
+ pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1536
+ lookbehind: !0,
1537
+ alias: "property"
1538
+ }
1539
+ });
1540
+ Prism.languages.markup && (Prism.languages.markup.tag.addInlined("script", "javascript"), Prism.languages.markup.tag.addAttribute(
1541
+ /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
1542
+ "javascript"
1543
+ ));
1544
+ Prism.languages.js = Prism.languages.javascript;
1545
+ Prism.languages.python = {
1546
+ comment: {
1547
+ pattern: /(^|[^\\])#.*/,
1548
+ lookbehind: !0,
1549
+ greedy: !0
1550
+ },
1551
+ "string-interpolation": {
1552
+ pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
1553
+ greedy: !0,
1554
+ inside: {
1555
+ interpolation: {
1556
+ // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
1557
+ pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
1558
+ lookbehind: !0,
1559
+ inside: {
1560
+ "format-spec": {
1561
+ pattern: /(:)[^:(){}]+(?=\}$)/,
1562
+ lookbehind: !0
1563
+ },
1564
+ "conversion-option": {
1565
+ pattern: /![sra](?=[:}]$)/,
1566
+ alias: "punctuation"
1567
+ },
1568
+ rest: null
1569
+ }
1570
+ },
1571
+ string: /[\s\S]+/
1572
+ }
1573
+ },
1574
+ "triple-quoted-string": {
1575
+ pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
1576
+ greedy: !0,
1577
+ alias: "string"
1578
+ },
1579
+ string: {
1580
+ pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
1581
+ greedy: !0
1582
+ },
1583
+ function: {
1584
+ pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
1585
+ lookbehind: !0
1586
+ },
1587
+ "class-name": {
1588
+ pattern: /(\bclass\s+)\w+/i,
1589
+ lookbehind: !0
1590
+ },
1591
+ decorator: {
1592
+ pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
1593
+ lookbehind: !0,
1594
+ alias: ["annotation", "punctuation"],
1595
+ inside: {
1596
+ punctuation: /\./
1597
+ }
1598
+ },
1599
+ keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
1600
+ builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
1601
+ boolean: /\b(?:False|None|True)\b/,
1602
+ number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
1603
+ operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
1604
+ punctuation: /[{}[\];(),.:]/
1605
+ };
1606
+ Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python;
1607
+ Prism.languages.py = Prism.languages.python;
1608
+ Prism.languages.go = Prism.languages.extend("clike", {
1609
+ string: {
1610
+ pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
1611
+ lookbehind: !0,
1612
+ greedy: !0
1613
+ },
1614
+ keyword: /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
1615
+ boolean: /\b(?:_|false|iota|nil|true)\b/,
1616
+ number: [
1617
+ // binary and octal integers
1618
+ /\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
1619
+ // hexadecimal integers and floats
1620
+ /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
1621
+ // decimal integers and floats
1622
+ /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i
1623
+ ],
1624
+ operator: /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
1625
+ builtin: /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
1626
+ });
1627
+ Prism.languages.insertBefore("go", "string", {
1628
+ char: {
1629
+ pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
1630
+ greedy: !0
1631
+ }
1632
+ });
1633
+ delete Prism.languages.go["class-name"];
1634
+ (function(r) {
1635
+ var e = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, t = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, l = {
1636
+ pattern: RegExp(/(^|[^\w.])/.source + t + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
1637
+ lookbehind: !0,
1638
+ inside: {
1639
+ namespace: {
1640
+ pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
1641
+ inside: {
1642
+ punctuation: /\./
1643
+ }
1644
+ },
1645
+ punctuation: /\./
1646
+ }
1647
+ };
1648
+ r.languages.java = r.languages.extend("clike", {
1649
+ string: {
1650
+ pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
1651
+ lookbehind: !0,
1652
+ greedy: !0
1653
+ },
1654
+ "class-name": [
1655
+ l,
1656
+ {
1657
+ // variables, parameters, and constructor references
1658
+ // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
1659
+ pattern: RegExp(/(^|[^\w.])/.source + t + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
1660
+ lookbehind: !0,
1661
+ inside: l.inside
1662
+ },
1663
+ {
1664
+ // class names based on keyword
1665
+ // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
1666
+ pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + t + /[A-Z]\w*\b/.source),
1667
+ lookbehind: !0,
1668
+ inside: l.inside
1669
+ }
1670
+ ],
1671
+ keyword: e,
1672
+ function: [
1673
+ r.languages.clike.function,
1674
+ {
1675
+ pattern: /(::\s*)[a-z_]\w*/,
1676
+ lookbehind: !0
1677
+ }
1678
+ ],
1679
+ number: /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
1680
+ operator: {
1681
+ pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
1682
+ lookbehind: !0
1683
+ },
1684
+ constant: /\b[A-Z][A-Z_\d]+\b/
1685
+ }), r.languages.insertBefore("java", "string", {
1686
+ "triple-quoted-string": {
1687
+ // http://openjdk.java.net/jeps/355#Description
1688
+ pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
1689
+ greedy: !0,
1690
+ alias: "string"
1691
+ },
1692
+ char: {
1693
+ pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
1694
+ greedy: !0
1695
+ }
1696
+ }), r.languages.insertBefore("java", "class-name", {
1697
+ annotation: {
1698
+ pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
1699
+ lookbehind: !0,
1700
+ alias: "punctuation"
1701
+ },
1702
+ generics: {
1703
+ pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
1704
+ inside: {
1705
+ "class-name": l,
1706
+ keyword: e,
1707
+ punctuation: /[<>(),.:]/,
1708
+ operator: /[?&|]/
1709
+ }
1710
+ },
1711
+ import: [
1712
+ {
1713
+ pattern: RegExp(/(\bimport\s+)/.source + t + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
1714
+ lookbehind: !0,
1715
+ inside: {
1716
+ namespace: l.inside.namespace,
1717
+ punctuation: /\./,
1718
+ operator: /\*/,
1719
+ "class-name": /\w+/
1720
+ }
1721
+ },
1722
+ {
1723
+ pattern: RegExp(/(\bimport\s+static\s+)/.source + t + /(?:\w+|\*)(?=\s*;)/.source),
1724
+ lookbehind: !0,
1725
+ alias: "static",
1726
+ inside: {
1727
+ namespace: l.inside.namespace,
1728
+ static: /\b\w+$/,
1729
+ punctuation: /\./,
1730
+ operator: /\*/,
1731
+ "class-name": /\w+/
1732
+ }
1733
+ }
1734
+ ],
1735
+ namespace: {
1736
+ pattern: RegExp(
1737
+ /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g, function() {
1738
+ return e.source;
1739
+ })
1740
+ ),
1741
+ lookbehind: !0,
1742
+ inside: {
1743
+ punctuation: /\./
1744
+ }
1745
+ }
1746
+ });
1747
+ })(Prism);
1748
+ Prism.languages.c = Prism.languages.extend("clike", {
1749
+ comment: {
1750
+ pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
1751
+ greedy: !0
1752
+ },
1753
+ string: {
1754
+ // https://en.cppreference.com/w/c/language/string_literal
1755
+ pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
1756
+ greedy: !0
1757
+ },
1758
+ "class-name": {
1759
+ pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
1760
+ lookbehind: !0
1761
+ },
1762
+ keyword: /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,
1763
+ function: /\b[a-z_]\w*(?=\s*\()/i,
1764
+ number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
1765
+ operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
1766
+ });
1767
+ Prism.languages.insertBefore("c", "string", {
1768
+ char: {
1769
+ // https://en.cppreference.com/w/c/language/character_constant
1770
+ pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
1771
+ greedy: !0
1772
+ }
1773
+ });
1774
+ Prism.languages.insertBefore("c", "string", {
1775
+ macro: {
1776
+ // allow for multiline macro definitions
1777
+ // spaces after the # character compile fine with gcc
1778
+ pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
1779
+ lookbehind: !0,
1780
+ greedy: !0,
1781
+ alias: "property",
1782
+ inside: {
1783
+ string: [
1784
+ {
1785
+ // highlight the path of the include statement as a string
1786
+ pattern: /^(#\s*include\s*)<[^>]+>/,
1787
+ lookbehind: !0
1788
+ },
1789
+ Prism.languages.c.string
1790
+ ],
1791
+ char: Prism.languages.c.char,
1792
+ comment: Prism.languages.c.comment,
1793
+ "macro-name": [
1794
+ {
1795
+ pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
1796
+ lookbehind: !0
1797
+ },
1798
+ {
1799
+ pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
1800
+ lookbehind: !0,
1801
+ alias: "function"
1802
+ }
1803
+ ],
1804
+ // highlight macro directives as keywords
1805
+ directive: {
1806
+ pattern: /^(#\s*)[a-z]+/,
1807
+ lookbehind: !0,
1808
+ alias: "keyword"
1809
+ },
1810
+ "directive-hash": /^#/,
1811
+ punctuation: /##|\\(?=[\r\n])/,
1812
+ expression: {
1813
+ pattern: /\S[\s\S]*/,
1814
+ inside: Prism.languages.c
1815
+ }
1816
+ }
1817
+ }
1818
+ });
1819
+ Prism.languages.insertBefore("c", "function", {
1820
+ // highlight predefined macros as constants
1821
+ constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
1822
+ });
1823
+ delete Prism.languages.c.boolean;
1824
+ (function(r) {
1825
+ for (var e = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, t = 0; t < 2; t++)
1826
+ e = e.replace(/<self>/g, function() {
1827
+ return e;
1828
+ });
1829
+ e = e.replace(/<self>/g, function() {
1830
+ return /[^\s\S]/.source;
1831
+ }), r.languages.rust = {
1832
+ comment: [
1833
+ {
1834
+ pattern: RegExp(/(^|[^\\])/.source + e),
1835
+ lookbehind: !0,
1836
+ greedy: !0
1837
+ },
1838
+ {
1839
+ pattern: /(^|[^\\:])\/\/.*/,
1840
+ lookbehind: !0,
1841
+ greedy: !0
1842
+ }
1843
+ ],
1844
+ string: {
1845
+ pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,
1846
+ greedy: !0
1847
+ },
1848
+ char: {
1849
+ pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,
1850
+ greedy: !0
1851
+ },
1852
+ attribute: {
1853
+ pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,
1854
+ greedy: !0,
1855
+ alias: "attr-name",
1856
+ inside: {
1857
+ string: null
1858
+ // see below
1859
+ }
1860
+ },
1861
+ // Closure params should not be confused with bitwise OR |
1862
+ "closure-params": {
1863
+ pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,
1864
+ lookbehind: !0,
1865
+ greedy: !0,
1866
+ inside: {
1867
+ "closure-punctuation": {
1868
+ pattern: /^\||\|$/,
1869
+ alias: "punctuation"
1870
+ },
1871
+ rest: null
1872
+ // see below
1873
+ }
1874
+ },
1875
+ "lifetime-annotation": {
1876
+ pattern: /'\w+/,
1877
+ alias: "symbol"
1878
+ },
1879
+ "fragment-specifier": {
1880
+ pattern: /(\$\w+:)[a-z]+/,
1881
+ lookbehind: !0,
1882
+ alias: "punctuation"
1883
+ },
1884
+ variable: /\$\w+/,
1885
+ "function-definition": {
1886
+ pattern: /(\bfn\s+)\w+/,
1887
+ lookbehind: !0,
1888
+ alias: "function"
1889
+ },
1890
+ "type-definition": {
1891
+ pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/,
1892
+ lookbehind: !0,
1893
+ alias: "class-name"
1894
+ },
1895
+ "module-declaration": [
1896
+ {
1897
+ pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,
1898
+ lookbehind: !0,
1899
+ alias: "namespace"
1900
+ },
1901
+ {
1902
+ pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,
1903
+ lookbehind: !0,
1904
+ alias: "namespace",
1905
+ inside: {
1906
+ punctuation: /::/
1907
+ }
1908
+ }
1909
+ ],
1910
+ keyword: [
1911
+ // https://github.com/rust-lang/reference/blob/master/src/keywords.md
1912
+ /\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,
1913
+ // primitives and str
1914
+ // https://doc.rust-lang.org/stable/rust-by-example/primitives.html
1915
+ /\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/
1916
+ ],
1917
+ // functions can technically start with an upper-case letter, but this will introduce a lot of false positives
1918
+ // and Rust's naming conventions recommend snake_case anyway.
1919
+ // https://doc.rust-lang.org/1.0.0/style/style/naming/README.html
1920
+ function: /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,
1921
+ macro: {
1922
+ pattern: /\b\w+!/,
1923
+ alias: "property"
1924
+ },
1925
+ constant: /\b[A-Z_][A-Z_\d]+\b/,
1926
+ "class-name": /\b[A-Z]\w*\b/,
1927
+ namespace: {
1928
+ pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,
1929
+ inside: {
1930
+ punctuation: /::/
1931
+ }
1932
+ },
1933
+ // Hex, oct, bin, dec numbers with visual separators and type suffix
1934
+ number: /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,
1935
+ boolean: /\b(?:false|true)\b/,
1936
+ punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,
1937
+ operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/
1938
+ }, r.languages.rust["closure-params"].inside.rest = r.languages.rust, r.languages.rust.attribute.inside.string = r.languages.rust.string;
1939
+ })(Prism);
1940
+ Prism.languages.sql = {
1941
+ comment: {
1942
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,
1943
+ lookbehind: !0
1944
+ },
1945
+ variable: [
1946
+ {
1947
+ pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,
1948
+ greedy: !0
1949
+ },
1950
+ /@[\w.$]+/
1951
+ ],
1952
+ string: {
1953
+ pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,
1954
+ greedy: !0,
1955
+ lookbehind: !0
1956
+ },
1957
+ identifier: {
1958
+ pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,
1959
+ greedy: !0,
1960
+ lookbehind: !0,
1961
+ inside: {
1962
+ punctuation: /^`|`$/
1963
+ }
1964
+ },
1965
+ function: /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,
1966
+ // Should we highlight user defined functions too?
1967
+ keyword: /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,
1968
+ boolean: /\b(?:FALSE|NULL|TRUE)\b/i,
1969
+ number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,
1970
+ operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
1971
+ punctuation: /[;[\]()`,.]/
1972
+ };
1973
+ (function(r) {
1974
+ var e = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", t = {
1975
+ pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
1976
+ lookbehind: !0,
1977
+ alias: "punctuation",
1978
+ // this looks reasonably well in all themes
1979
+ inside: null
1980
+ // see below
1981
+ }, l = {
1982
+ bash: t,
1983
+ environment: {
1984
+ pattern: RegExp("\\$" + e),
1985
+ alias: "constant"
1986
+ },
1987
+ variable: [
1988
+ // [0]: Arithmetic Environment
1989
+ {
1990
+ pattern: /\$?\(\([\s\S]+?\)\)/,
1991
+ greedy: !0,
1992
+ inside: {
1993
+ // If there is a $ sign at the beginning highlight $(( and )) as variable
1994
+ variable: [
1995
+ {
1996
+ pattern: /(^\$\(\([\s\S]+)\)\)/,
1997
+ lookbehind: !0
1998
+ },
1999
+ /^\$\(\(/
2000
+ ],
2001
+ number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
2002
+ // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
2003
+ operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
2004
+ // If there is no $ sign at the beginning highlight (( and )) as punctuation
2005
+ punctuation: /\(\(?|\)\)?|,|;/
2006
+ }
2007
+ },
2008
+ // [1]: Command Substitution
2009
+ {
2010
+ pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
2011
+ greedy: !0,
2012
+ inside: {
2013
+ variable: /^\$\(|^`|\)$|`$/
2014
+ }
2015
+ },
2016
+ // [2]: Brace expansion
2017
+ {
2018
+ pattern: /\$\{[^}]+\}/,
2019
+ greedy: !0,
2020
+ inside: {
2021
+ operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
2022
+ punctuation: /[\[\]]/,
2023
+ environment: {
2024
+ pattern: RegExp("(\\{)" + e),
2025
+ lookbehind: !0,
2026
+ alias: "constant"
2027
+ }
2028
+ }
2029
+ },
2030
+ /\$(?:\w+|[#?*!@$])/
2031
+ ],
2032
+ // Escape sequences from echo and printf's manuals, and escaped quotes.
2033
+ entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
2034
+ };
2035
+ r.languages.bash = {
2036
+ shebang: {
2037
+ pattern: /^#!\s*\/.*/,
2038
+ alias: "important"
2039
+ },
2040
+ comment: {
2041
+ pattern: /(^|[^"{\\$])#.*/,
2042
+ lookbehind: !0
2043
+ },
2044
+ "function-name": [
2045
+ // a) function foo {
2046
+ // b) foo() {
2047
+ // c) function foo() {
2048
+ // but not “foo {”
2049
+ {
2050
+ // a) and c)
2051
+ pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
2052
+ lookbehind: !0,
2053
+ alias: "function"
2054
+ },
2055
+ {
2056
+ // b)
2057
+ pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
2058
+ alias: "function"
2059
+ }
2060
+ ],
2061
+ // Highlight variable names as variables in for and select beginnings.
2062
+ "for-or-select": {
2063
+ pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
2064
+ alias: "variable",
2065
+ lookbehind: !0
2066
+ },
2067
+ // Highlight variable names as variables in the left-hand part
2068
+ // of assignments (“=” and “+=”).
2069
+ "assign-left": {
2070
+ pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
2071
+ inside: {
2072
+ environment: {
2073
+ pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + e),
2074
+ lookbehind: !0,
2075
+ alias: "constant"
2076
+ }
2077
+ },
2078
+ alias: "variable",
2079
+ lookbehind: !0
2080
+ },
2081
+ // Highlight parameter names as variables
2082
+ parameter: {
2083
+ pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
2084
+ alias: "variable",
2085
+ lookbehind: !0
2086
+ },
2087
+ string: [
2088
+ // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
2089
+ {
2090
+ pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
2091
+ lookbehind: !0,
2092
+ greedy: !0,
2093
+ inside: l
2094
+ },
2095
+ // Here-document with quotes around the tag
2096
+ // → No expansion (so no “inside”).
2097
+ {
2098
+ pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
2099
+ lookbehind: !0,
2100
+ greedy: !0,
2101
+ inside: {
2102
+ bash: t
2103
+ }
2104
+ },
2105
+ // “Normal” string
2106
+ {
2107
+ // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
2108
+ pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
2109
+ lookbehind: !0,
2110
+ greedy: !0,
2111
+ inside: l
2112
+ },
2113
+ {
2114
+ // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
2115
+ pattern: /(^|[^$\\])'[^']*'/,
2116
+ lookbehind: !0,
2117
+ greedy: !0
2118
+ },
2119
+ {
2120
+ // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
2121
+ pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
2122
+ greedy: !0,
2123
+ inside: {
2124
+ entity: l.entity
2125
+ }
2126
+ }
2127
+ ],
2128
+ environment: {
2129
+ pattern: RegExp("\\$?" + e),
2130
+ alias: "constant"
2131
+ },
2132
+ variable: l.variable,
2133
+ function: {
2134
+ pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
2135
+ lookbehind: !0
2136
+ },
2137
+ keyword: {
2138
+ pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
2139
+ lookbehind: !0
2140
+ },
2141
+ // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
2142
+ builtin: {
2143
+ pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
2144
+ lookbehind: !0,
2145
+ // Alias added to make those easier to distinguish from strings.
2146
+ alias: "class-name"
2147
+ },
2148
+ boolean: {
2149
+ pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
2150
+ lookbehind: !0
2151
+ },
2152
+ "file-descriptor": {
2153
+ pattern: /\B&\d\b/,
2154
+ alias: "important"
2155
+ },
2156
+ operator: {
2157
+ // Lots of redirections here, but not just that.
2158
+ pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
2159
+ inside: {
2160
+ "file-descriptor": {
2161
+ pattern: /^\d/,
2162
+ alias: "important"
2163
+ }
2164
+ }
2165
+ },
2166
+ punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
2167
+ number: {
2168
+ pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
2169
+ lookbehind: !0
2170
+ }
2171
+ }, t.inside = r.languages.bash;
2172
+ for (var p = [
2173
+ "comment",
2174
+ "function-name",
2175
+ "for-or-select",
2176
+ "assign-left",
2177
+ "parameter",
2178
+ "string",
2179
+ "environment",
2180
+ "function",
2181
+ "keyword",
2182
+ "builtin",
2183
+ "boolean",
2184
+ "file-descriptor",
2185
+ "operator",
2186
+ "punctuation",
2187
+ "number"
2188
+ ], f = l.variable[1].inside, b = 0; b < p.length; b++)
2189
+ f[p[b]] = r.languages.bash[p[b]];
2190
+ r.languages.sh = r.languages.bash, r.languages.shell = r.languages.bash;
2191
+ })(Prism);
2192
+ Prism.languages.json = {
2193
+ property: {
2194
+ pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
2195
+ lookbehind: !0,
2196
+ greedy: !0
2197
+ },
2198
+ string: {
2199
+ pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
2200
+ lookbehind: !0,
2201
+ greedy: !0
2202
+ },
2203
+ comment: {
2204
+ pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
2205
+ greedy: !0
2206
+ },
2207
+ number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
2208
+ punctuation: /[{}[\],]/,
2209
+ operator: /:/,
2210
+ boolean: /\b(?:false|true)\b/,
2211
+ null: {
2212
+ pattern: /\bnull\b/,
2213
+ alias: "keyword"
2214
+ }
2215
+ };
2216
+ Prism.languages.webmanifest = Prism.languages.json;
2217
+ function ee(r, e, t, l, p, f, b, u) {
2218
+ var h = typeof r == "function" ? r.options : r;
2219
+ return e && (h.render = e, h.staticRenderFns = t, h._compiled = !0), f && (h._scopeId = "data-v-" + f), {
2220
+ exports: r,
2221
+ options: h
2222
+ };
2223
+ }
2224
+ function J(r) {
2225
+ if (!(typeof document > "u")) {
2226
+ var e = r === "dark" ? "prism-okaidia" : "prism", t = document.getElementById("prism-theme-style"), l = "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/" + e + ".min.css";
2227
+ if (t)
2228
+ t.setAttribute("href", l);
2229
+ else {
2230
+ var p = document.createElement("link");
2231
+ p.id = "prism-theme-style", p.rel = "stylesheet", p.href = l, document.head.appendChild(p);
2232
+ }
2233
+ }
2234
+ }
2235
+ typeof window < "u" && (window.Prism = j);
2236
+ const de = {
2237
+ name: "CodeEditor",
2238
+ props: {
2239
+ value: {
2240
+ type: String,
2241
+ default: ""
2242
+ },
2243
+ language: {
2244
+ type: String,
2245
+ default: "javascript"
2246
+ },
2247
+ theme: {
2248
+ type: String,
2249
+ default: "dark"
2250
+ },
2251
+ disabled: {
2252
+ type: Boolean,
2253
+ default: !1
2254
+ }
2255
+ },
2256
+ data: function() {
2257
+ return {
2258
+ highlightRef: null
2259
+ };
2260
+ },
2261
+ computed: {
2262
+ languageMap: function() {
2263
+ return {
2264
+ javascript: "javascript",
2265
+ js: "javascript",
2266
+ typescript: "typescript",
2267
+ ts: "typescript",
2268
+ python: "python",
2269
+ py: "python",
2270
+ java: "java",
2271
+ c: "c",
2272
+ cpp: "cpp",
2273
+ "c++": "cpp",
2274
+ csharp: "csharp",
2275
+ "c#": "csharp",
2276
+ go: "go",
2277
+ golang: "go",
2278
+ rust: "rust",
2279
+ ruby: "ruby",
2280
+ rb: "ruby",
2281
+ php: "php",
2282
+ swift: "swift",
2283
+ kotlin: "kotlin",
2284
+ kt: "kotlin",
2285
+ sql: "sql",
2286
+ bash: "bash",
2287
+ sh: "bash",
2288
+ shell: "bash",
2289
+ json: "json",
2290
+ yaml: "yaml",
2291
+ yml: "yaml",
2292
+ markdown: "markdown",
2293
+ md: "markdown"
2294
+ };
2295
+ },
2296
+ prismLanguage: function() {
2297
+ return this.languageMap[this.language.toLowerCase()] || "javascript";
2298
+ },
2299
+ editorBackground: function() {
2300
+ return this.theme === "dark" ? "#1e1e1e" : "#fafafa";
2301
+ },
2302
+ highlightedCode: function() {
2303
+ try {
2304
+ var r = j.languages[this.prismLanguage];
2305
+ if (r)
2306
+ return j.highlight(
2307
+ this.value || "",
2308
+ r,
2309
+ this.prismLanguage
2310
+ );
2311
+ } catch {
2312
+ }
2313
+ return this.escapeHtml(this.value || "");
2314
+ }
2315
+ },
2316
+ watch: {
2317
+ theme: function(r) {
2318
+ J(r);
2319
+ }
2320
+ },
2321
+ mounted: function() {
2322
+ J(this.theme);
2323
+ },
2324
+ methods: {
2325
+ escapeHtml: function(r) {
2326
+ var e = document.createElement("div");
2327
+ return e.textContent = r, e.innerHTML;
2328
+ },
2329
+ handleInput: function(r) {
2330
+ this.$emit("input", r.target.value), this.$emit("update:value", r.target.value);
2331
+ },
2332
+ handleScroll: function(r) {
2333
+ var e = this.$refs.highlightRef;
2334
+ e && (e.scrollTop = r.target.scrollTop, e.scrollLeft = r.target.scrollLeft);
2335
+ },
2336
+ handleKeydown: function(r) {
2337
+ if (r.key === "Tab") {
2338
+ r.preventDefault();
2339
+ var e = r.target, t = e.selectionStart, l = e.selectionEnd, p = e.value;
2340
+ e.value = p.substring(0, t) + " " + p.substring(l), e.selectionStart = e.selectionEnd = t + 2, this.$emit("input", e.value), this.$emit("update:value", e.value);
2341
+ }
2342
+ }
2343
+ }
2344
+ };
2345
+ var pe = function() {
2346
+ var e = this, t = e._self._c;
2347
+ return t("div", { staticClass: "code-editor", class: "theme-" + e.theme, style: { background: e.editorBackground } }, [t("pre", { ref: "highlightRef", staticClass: "code-highlight", class: "language-" + e.prismLanguage, attrs: { "aria-hidden": "true" } }, [t("code", { domProps: { innerHTML: e._s(e.highlightedCode) } })]), t("textarea", { staticClass: "code-input", attrs: { disabled: e.disabled, spellcheck: "false", placeholder: "Write your code here..." }, domProps: { value: e.value }, on: { input: e.handleInput, scroll: e.handleScroll, keydown: e.handleKeydown } })]);
2348
+ }, ge = [], he = /* @__PURE__ */ ee(
2349
+ de,
2350
+ pe,
2351
+ ge,
2352
+ !1,
2353
+ null,
2354
+ "c829bd35"
2355
+ );
2356
+ const fe = he.exports, me = {
2357
+ name: "CodeRunner",
2358
+ components: {
2359
+ CodeEditor: fe
2360
+ },
2361
+ props: {
2362
+ pistonUrl: {
2363
+ type: String,
2364
+ default: "/api/piston"
2365
+ },
2366
+ language: {
2367
+ type: String,
2368
+ default: "javascript"
2369
+ },
2370
+ theme: {
2371
+ type: String,
2372
+ default: "light",
2373
+ validator: function(r) {
2374
+ return ["light", "dark"].indexOf(r) !== -1;
2375
+ }
2376
+ },
2377
+ showLanguageSelector: {
2378
+ type: Boolean,
2379
+ default: !0
2380
+ },
2381
+ showEditor: {
2382
+ type: Boolean,
2383
+ default: !0
2384
+ },
2385
+ editable: {
2386
+ type: Boolean,
2387
+ default: !0
2388
+ },
2389
+ defaultCode: {
2390
+ type: String,
2391
+ default: ""
2392
+ },
2393
+ executorLabel: {
2394
+ type: String,
2395
+ default: "运行"
2396
+ }
2397
+ },
2398
+ data: function() {
2399
+ return {
2400
+ runtimes: [],
2401
+ currentLanguage: this.language,
2402
+ currentTheme: this.theme,
2403
+ code: this.defaultCode || z(this.language),
2404
+ output: "",
2405
+ stderr: "",
2406
+ isRunning: !1,
2407
+ executionTime: null,
2408
+ activeTab: "stdout",
2409
+ error: null,
2410
+ runtimesLoading: !1,
2411
+ client: null,
2412
+ editorWidth: 60
2413
+ };
2414
+ },
2415
+ computed: {
2416
+ themeClass: function() {
2417
+ return "code-runner-" + this.currentTheme;
2418
+ },
2419
+ languageOptions: function() {
2420
+ return this.runtimes.map(function(r) {
2421
+ return {
2422
+ value: r.language + ":" + r.version,
2423
+ label: r.language.charAt(0).toUpperCase() + r.language.slice(1) + " " + r.version
2424
+ };
2425
+ });
2426
+ },
2427
+ languageName: function() {
2428
+ var r = this.currentLanguage;
2429
+ return r.includes(":") ? r.split(":")[0] : r;
2430
+ }
2431
+ },
2432
+ watch: {
2433
+ currentLanguage: function(r) {
2434
+ var e = r.includes(":") ? r.split(":")[0] : r;
2435
+ this.code = z(e), this.$emit("language-change", e, this.code);
2436
+ }
2437
+ },
2438
+ mounted: function() {
2439
+ this.client = new oe({ pistonUrl: this.pistonUrl }), this.loadRuntimes();
2440
+ },
2441
+ methods: {
2442
+ loadRuntimes: function() {
2443
+ var r = this;
2444
+ this.runtimesLoading = !0, this.error = null, this.client.getRuntimes().then(function(e) {
2445
+ r.runtimes = e;
2446
+ }).catch(function(e) {
2447
+ r.error = e.message || "Failed to load runtimes";
2448
+ }).finally(function() {
2449
+ r.runtimesLoading = !1;
2450
+ });
2451
+ },
2452
+ execute: function() {
2453
+ var r = this;
2454
+ this.isRunning || (this.isRunning = !0, this.output = "", this.stderr = "", this.executionTime = null, this.error = null, this.activeTab = "stdout", this.$emit("execute-start"), this.client.execute(this.languageName, this.code).then(function(e) {
2455
+ r.output = e.output, r.stderr = e.stderr, r.executionTime = e.executionTime || null, r.activeTab = e.stderr ? "stderr" : "stdout", r.$emit("execute-end", e);
2456
+ }).catch(function(e) {
2457
+ r.error = e.message || "Execution failed", r.$emit("execute-end", {
2458
+ success: !1,
2459
+ output: "",
2460
+ stderr: r.error,
2461
+ code: -1
2462
+ });
2463
+ }).finally(function() {
2464
+ r.isRunning = !1;
2465
+ }));
2466
+ },
2467
+ clearOutput: function() {
2468
+ this.output = "", this.stderr = "", this.executionTime = null, this.error = null;
2469
+ },
2470
+ copyOutput: function() {
2471
+ var r = this.activeTab === "stdout" ? this.output : this.stderr;
2472
+ navigator.clipboard.writeText(r);
2473
+ },
2474
+ resetCode: function() {
2475
+ this.code = z(this.languageName);
2476
+ },
2477
+ toggleTheme: function() {
2478
+ this.currentTheme = this.currentTheme === "light" ? "dark" : "light";
2479
+ },
2480
+ startDrag: function(r) {
2481
+ var e = this, t = document.querySelector(".code-runner-main");
2482
+ if (t) {
2483
+ var l = function(f) {
2484
+ var b = t.getBoundingClientRect(), u = (f.clientX - b.left) / b.width * 100;
2485
+ e.editorWidth = Math.max(20, Math.min(80, u));
2486
+ }, p = function() {
2487
+ document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", p), document.body.style.cursor = "", document.body.style.userSelect = "";
2488
+ };
2489
+ document.addEventListener("mousemove", l), document.addEventListener("mouseup", p), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
2490
+ }
2491
+ }
2492
+ }
2493
+ };
2494
+ var be = function() {
2495
+ var e = this, t = e._self._c;
2496
+ return t("div", { class: ["code-runner", e.themeClass] }, [t("div", { staticClass: "code-runner-header" }, [t("div", { staticClass: "code-runner-controls" }, [e.showLanguageSelector ? t("select", { directives: [{ name: "model", rawName: "v-model", value: e.currentLanguage, expression: "currentLanguage" }], staticClass: "language-select", attrs: { disabled: e.isRunning }, on: { change: function(l) {
2497
+ var p = Array.prototype.filter.call(l.target.options, function(f) {
2498
+ return f.selected;
2499
+ }).map(function(f) {
2500
+ var b = "_value" in f ? f._value : f.value;
2501
+ return b;
2502
+ });
2503
+ e.currentLanguage = l.target.multiple ? p : p[0];
2504
+ } } }, [e.runtimesLoading ? t("option", { attrs: { value: "" } }, [e._v("加载中...")]) : e._e(), e._l(e.languageOptions, function(l) {
2505
+ return t("option", { key: l.value, domProps: { value: l.value } }, [e._v(" " + e._s(l.label) + " ")]);
2506
+ })], 2) : e._e()]), t("div", { staticClass: "code-runner-actions" }, [t("button", { staticClass: "btn btn-run", attrs: { disabled: e.isRunning || e.runtimesLoading }, on: { click: e.execute } }, [e.isRunning ? t("span", { staticClass: "spinner" }) : t("span", { staticClass: "run-icon" }, [e._v("▶")]), e._v(" " + e._s(e.isRunning ? "运行中..." : e.executorLabel) + " ")]), e.showEditor && e.editable ? t("button", { staticClass: "btn btn-reset", on: { click: e.resetCode } }, [e._v(" 重置 ")]) : e._e(), t("button", { staticClass: "btn btn-theme", attrs: { title: e.currentTheme === "light" ? "Switch to dark mode" : "Switch to light mode" }, on: { click: e.toggleTheme } }, [e._v(" " + e._s(e.currentTheme === "light" ? "🌙" : "☀️") + " ")])])]), e.error ? t("div", { staticClass: "error-message" }, [e._v(" " + e._s(e.error) + " ")]) : e._e(), t("div", { staticClass: "code-runner-main" }, [e.showEditor ? t("div", { staticClass: "editor-panel", style: { width: e.editorWidth + "%" } }, [t("div", { staticClass: "panel-header" }, [t("span", { staticClass: "panel-title" }, [e._v("编辑器")]), t("span", { staticClass: "language-badge" }, [e._v(e._s(e.languageName))])]), t("CodeEditor", { attrs: { value: e.code, language: e.languageName, theme: e.currentTheme, disabled: !e.editable || e.isRunning }, on: { input: function(l) {
2507
+ e.code = l;
2508
+ } } })], 1) : e._e(), e.showEditor ? t("div", { staticClass: "resize-handle", on: { mousedown: e.startDrag } }, [t("div", { staticClass: "resize-line" })]) : e._e(), t("div", { staticClass: "output-panel", style: { width: e.showEditor ? 100 - e.editorWidth + "%" : "100%" } }, [t("div", { staticClass: "panel-header" }, [t("div", { staticClass: "output-tabs" }, [t("button", { class: ["tab", { active: e.activeTab === "stdout" }], on: { click: function(l) {
2509
+ e.activeTab = "stdout";
2510
+ } } }, [e._v(" 输出 ")]), e.stderr ? t("button", { class: ["tab", { active: e.activeTab === "stderr" }], on: { click: function(l) {
2511
+ e.activeTab = "stderr";
2512
+ } } }, [e._v(" 错误 ")]) : e._e()]), t("div", { staticClass: "output-actions" }, [e.executionTime !== null ? t("span", { staticClass: "execution-time" }, [e._v(" " + e._s(e.executionTime) + "ms ")]) : e._e(), t("button", { staticClass: "btn-icon", attrs: { title: "复制" }, on: { click: e.copyOutput } }, [t("svg", { attrs: { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" } }, [t("rect", { attrs: { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" } }), t("path", { attrs: { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" } })])]), t("button", { staticClass: "btn-icon", attrs: { title: "清除" }, on: { click: e.clearOutput } }, [t("svg", { attrs: { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" } }, [t("polyline", { attrs: { points: "3 6 5 6 21 6" } }), t("path", { attrs: { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" } })])])])]), t("div", { staticClass: "output-content" }, [e.activeTab === "stdout" ? t("pre", [e._v(e._s(e.output || '点击"运行"执行代码'))]) : t("pre", { staticClass: "stderr" }, [e._v(e._s(e.stderr))])])])])]);
2513
+ }, Ee = [], ve = /* @__PURE__ */ ee(
2514
+ me,
2515
+ be,
2516
+ Ee,
2517
+ !1,
2518
+ null,
2519
+ "95eacecd"
2520
+ );
2521
+ const W = ve.exports;
2522
+ W.install = (r) => {
2523
+ r.component("CodeRunner", W);
2524
+ };
2525
+ const Ae = {
2526
+ install(r) {
2527
+ r.component("CodeRunner", W);
2528
+ }
2529
+ };
2530
+ export {
2531
+ W as CodeRunner,
2532
+ Ae as default
2533
+ };